package com.ego.product.feign;

import com.ego.common.to.SkuEsTo;
import com.ego.common.util.Result;
import com.ego.common.vo.es.SearchParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @program: ego
 * @description: 第三方服务接口
 * @author: KamTang
 * @create: 2022-11-29 14:33
 **/
@FeignClient("ego-third-party")
public interface ThirdPartyFeign {
    /**
     * 将商品信息添加到ES
     * @param skuEss @see
     * @return 公共返回对象
     * @see SkuEsTo
     */
    @PostMapping("/es/product/put")
    Result put(@RequestBody List<SkuEsTo> skuEss);

    /**
     * 使用ES完成首页检索功能
     * @param param @see
     * @return 公共返回对象
     * @see SearchParam
     */
    @PostMapping("/es/product/search")
    Result search(@RequestBody SearchParam param);

    /**
     * 短信发送
     * @param phone 手机号
     * @param code 验证码
     * @return @see
     * @see Result
     */
    @GetMapping("/sms/code")
    Result sendCode(@RequestParam("phone") String phone, @RequestParam("code")String code);
}
